﻿using System;
using System.Windows.Data;

namespace HSS.Xaml.UI.Data
{
	/// <summary>
	/// Convert a null object to true and a non-null value to false.
	/// </summary>
	public class NullTrueValueConverter : IValueConverter
	{
		/// <summary>
		/// Converts the value to a boolean (false if not null and true if is null).
		/// </summary>
		/// <param name="value">The value.</param>
		/// <param name="targetType">The target type.</param>
		/// <param name="parameter">The optional parameter.</param>
		/// <param name="culture">the requested culture.</param>
		/// <returns>true if the value is not null; otherwise false.</returns>
		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			if (null == value)
				return true;
			else
				return false;
		}
		/// <summary>
		/// NotImplementedException
		/// </summary>
		/// <param name="value"></param>
		/// <param name="targetType"></param>
		/// <param name="parameter"></param>
		/// <param name="culture"></param>
		/// <returns>NotImplementedException</returns>
		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}
}
